Chronic pain affects 40-70 million people with nearly 90% experiencing disturbed sleep. While it is plausible that insomnia occurring in association with chronic pain has the same etiologic factors that contribute to Primary Insomnia little work has been undertaken to determine whether cognitive-behavioral therapy for insomnia (CBT-I) can be successfully applied to insomnia secondary to chronic pain. We propose to address this issue and to further assess whether clinical gains within the sleep domain are related to greater pain tolerance, improved mood and enhanced quality of life. Twenty subjects with insomnia secondary to pain will complete a two-way, cross-over designed study following a polysomnography screen. Participants will be randomized to receive either CBT-I or CBT for pain (CBT-P) as the first of two treatments. Each treatment will occur with trained clinicians in 8 weekly, individual sessions. Sleep, pain mood and quality of life symptoms will be monitored for a 2 week baseline period, weekly during each treatment phase and for a 2 week interval at 3 months post treatment. The data obtained from this F32 will be used to create effect size estimates for 1) the efficacy of CBT-I vs CBT-P and 2) the effects of improved sleep continuity on pain, mood, and quality of life. A secondary aim is to profile and compare subjects' sleep architecture and quantitative sleep EEGs to archival data from patients with other insomnias and with Good Sleepers. It is anticipated, that CBT-I will product moderate to large effects for both the primary and secondary outcome measures. If the project is successful, these data will be used as the basis for an R21 and/or a K23 application. Finally, it is anticipated that studies of this kind will provide the evidence required to make CBT-I a standard of practice for the management of chronic pain.